<include file="Public:header" />
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
	    <div class="col-lg-12">
			<div class="title-bar">
				<div class="row " id="title-show">
					<ul class="nav pull-left" style="margin:0px 10px 0px 20px;">
						<span>
							<img src="__PUBLIC__/img/contract_view_icon.png" style="margin-bottom:9px;" alt="">
						</span>
						<span style="font-size:21px;margin-left:5px">
							<switch name="info['type']">
								<case value="1">普通审批</case>
								<case value="2">请假单</case>
								<case value="3">普通报销</case>
								<case value="4">差旅报销</case>
								<case value="5">出差申请</case>
								<case value="6">借款申请</case>
							</switch>
						</span>&nbsp;&nbsp; 
						<if condition="$info['examine_status'] eq 2">
							<span class="badge badge-success check_badge" style="padding:5px 20px;margin-top:-8px;background:#8BC34A;color:#fff;">通过</span>&nbsp;
						<elseif condition="$info['examine_status'] eq 3"/>
							<span class="badge badge-error check_badge" style="color:#fff;padding:5px 20px;margin-top:-8px;background:#F5715F">拒绝</span>&nbsp;
						<elseif condition="$info['examine_status'] eq 1"/>
							<span class="badge badge-error check_badge" style="color:#fff;padding:5px 20px;margin-top:-8px;background:#F5715F">审批中</span>&nbsp;
						<else />
							<span class="badge badge-warning" style="color:#fff;padding:5px 20px;margin-top:-8px;background:#F5CA00">待审</span>
						</if>
					</ul>
					<if condition = "$info['examine_status'] lt 2 || $info['examine_status'] eq 3">
						<a href="{:U('examine/edit','id='.$info['examine_id'].'&type='.$info['type'])}" class="btn btn-outline btn-default pull-right" style="margin-right: 15px;"><i class="fa fa-pencil"></i>&nbsp;&nbsp;编辑</a>&nbsp;&nbsp;
					</if>
					<if condition="$info['examine_status'] lt 2">
						<input type="hidden" id="is_checked" value="1"/>
						<a href="javascript:void(0);" id="check_examine" style="margin-right:15px;" rel2="{$info['type']}" rel="{$info['examine_id']}" class="btn btn-primary pull-right">审核</a>
					</if>
				</div>
			</div>
			<div class="tabs-container" style="border:1px solid #ccc;">
				<div style="padding:15px 0 0 20px;background:#fff;" id="left-content">
					<ul class="nav nav-tabs" id="left_list" style="height:40px;">
						<li class="active" ><a href="#tab1" data-toggle="tab" type="tab1">基本信息</a></li>
					</ul>
					<div class="tab-content ">
						<div class="tab-pane in active " id="tab1">
							<div class="panel-body ">
								<include file="Public:alert" />
								<div style="font-size:13px;font-weight:700;margin:15px auto;"><span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>基本信息</div>
								<div class="form-horizontal view-group " style="margin-left:-10px;">
								<switch name="info['type']">
									<case value="1">
										<div class="form-group">
											<label class="col-lg-2 control-label">申请人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
										</div>
										<if condition = "$info['examine_status'] lt 2">
											<div class="form-group">
												<label class="col-lg-2 control-label">审批人</label>
												<div class="col-lg-8">
													<p class="form-p">
														{$info['examine']['user_name']}
													</p>
												</div>
											</div>
										</if>
										<div class="form-group">
											<label class="col-lg-2 control-label">申请事由</label>
											<div class="col-lg-8">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
									</case>
									<case value="2">
										<div class="form-group">
											<label class="col-lg-2 control-label">请假人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
											<label class="col-lg-2 control-label">请假事项</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">请假事由</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['description']}
												</p>
											</div>
											<label class="col-lg-2 control-label">请假天数</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['duration']}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">开始时间</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['start_time']|date='Y-m-d H:i',###}
												</p>
											</div>
											<label class="col-lg-2 control-label">结束时间</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['end_time']|date='Y-m-d H:i',###}
												</p>
											</div>
										</div>
										<if condition="$info['examine_status'] lt 2">
											<div class="form-group">
												<label class="col-lg-2 control-label">审批人</label>
												<div class="col-lg-4">
													<p class="form-p">
														{$info['examine']['user_name']}
													</p>
												</div>
												<div class="col-lo-6"></div>
											</div>
										</if>
									</case>
									<case value="3">
										<div class="form-group">
											<label class="col-lg-2 control-label">申请人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
											<label class="col-lg-2 control-label">报销事由</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">审批人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['examine']['user_name']}
												</p>
											</div>
											<label class="col-lg-2 control-label">总金额(元)</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['budget']}
												</p>
											</div>
										</div>
										<div style="font-size:13px;font-weight:700;margin:15px 10px;"><span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>报销信息</div>
										<div class="form-group">
											<div class="col-lg-12" >
												<table class="table" style="margin:10px 20px 20px 20px;width:97%">
													<thead>
														<tr style="background-color:#F5F5F6;">
															<td style="color:#7D919F">事项</td>
															<td style="color:#7D919F">报销项</td>
															<td style="color:#7D919F">金额(元)</td>
															<td style="color:#7D919F">备注</td>
														</tr>
													</thead>
													<tbody>
														<volist name="info['travel']" id="vo">
															<tr >
																<td>{$key+1}</td>
																<td>{$vo['start_address']}</td>
																<td>{$vo['money']}</td>
																<td>{$vo['description']}</td>
															</tr>
														</volist>
													</tbody>
												</table>
											</div>
										</div>
										<div style="font-size:13px;font-weight:700;margin:15px 10px;"><span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>附件信息({$info['file_count']})</div>
										<div class="form-group">
											<div class="col-lg-6">
												<div class="filelist" style="margin-left:20px;">
													<!-- <span class="tsinfo"><img src="__PUBLIC__/img/addFile.png"/><span class="fujian">附件&nbsp;({$info['file_count']})</span></span> -->
													<volist name="info['file_list']" id="vo">
														<div class="file_tr" style="padding: 6px;">
															<img src="__PUBLIC__/productImg/{$vo['pic']}">&nbsp;<a <if condition="in_array(getExtension($vo['name']),imgFormat())">class="litebox_file" href="{$vo['file_path']}" title="点击查看大图" data-litebox-group="group-{$info['examine
															_id']}"</if>>{$vo.name}</a><span style="color:#646464;">&nbsp;(&nbsp;{$vo['size']}KB&nbsp;)</span>&nbsp;&nbsp;<a class="controls_file" style="float: right;display: none;margin-right: 20px;" href="javascript:;" file="{$vo.file_path}" filename="{$vo.name}" onclick="filedown(this);">下载</a></div>
													</volist>
												</div>
											</div>
										</div>
									</case>
									<case value="4">
										<div class="form-group">
											<label class="col-lg-2 control-label">申请人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
											<label class="col-lg-2 control-label">报销事由</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">审批人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['examine']['user_name']}
												</p>
											</div>
											<label class="col-lg-2 control-label">总金额(元)</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['budget']}
												</p>
											</div>
										</div>
										<div style="font-size:13px;font-weight:700;margin:15px 10px;"><span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>报销信息</div>
										<div class="form-group">
											<div class="col-lg-12" >
												<table class="table" style="margin:10px 20px 20px 20px;width:97%">
													<thead>
														<tr style="background-color:#F5F5F6;">
															<td style="color:#7D919F">行程</td>
															<td style="color:#7D919F">出发地</td>
															<td style="color:#7D919F">出发时间</td>
															<td style="color:#7D919F">目的地</td>
															<td style="color:#7D919F">到达时间</td>
															<td style="color:#7D919F">交通工具</td>
															<td style="color:#7D919F">住宿(天)</td>
															<td style="color:#7D919F">金额(元)</td>
															<td style="color:#7D919F">备注</td>
														</tr>
													</thead>
													<tbody>
														<volist name="info['travel']" id="vo">
															<tr >
																<td>{$key+1}</td>
																<td>{$vo['start_address']}</td>
																<td>{$vo['start_time']|date='Y-m-d',###}</td>
																<td>{$vo['end_address']}</td>
																<td>{$vo['end_time']|date='Y-m-d',###}</td>
																<td>{$vo['vehicle']}</td>
																<td>{$vo['duration']}</td>
																<td>{$vo['money']}</td>
																<td>{$vo['description']}</td>
															</tr>
														</volist>
													</tbody>
												</table>
											</div>
										</div>
										<div style="font-size:13px;font-weight:700;margin:15px 10px;"><span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>附件信息({$info['file_count']})</div>
										<div class="form-group">
											<div class="col-lg-6">
												<div class="filelist" style="margin-left:20px;">
													<!-- <span class="tsinfo"><img src="__PUBLIC__/img/addFile.png"/><span class="fujian">附件&nbsp;({$info['file_count']})</span></span> -->
													<volist name="info['file_list']" id="vo">
														<div class="file_tr" style="padding: 6px;">
															<img src="__PUBLIC__/productImg/{$vo['pic']}">&nbsp;<a <if condition="in_array(getExtension($vo['name']),imgFormat())">class="litebox_file" href="{$vo['file_path']}" title="点击查看大图" data-litebox-group="group-{$log['examine
															_id']}"</if>>{$vo.name}</a><span style="color:#646464;">&nbsp;(&nbsp;{$vo['size']}KB&nbsp;)</span>&nbsp;&nbsp;<a class="controls_file" style="float: right;display: none;margin-right: 20px;" href="javascript:;" file="{$vo.file_path}" filename="{$vo.name}" onclick="filedown(this);">下载</a></div>
													</volist>
												</div>
											</div>
										</div>
									</case>
									<case value="5">
										<div class="form-group">
											<label class="col-lg-2 control-label">出差人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
											<label class="col-lg-2 control-label">出差事由</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">审批人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['examine']['user_name']}
												</p>
											</div>
											<label class="col-lg-2 control-label">预算(元)</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['budget']}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">出发地</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['start_address']}
												</p>
											</div>
											<label class="col-lg-2 control-label">目的地</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['end_address']}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">出发时间</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['start_time']|date='Y-m-d H:i',###}
												</p>
											</div>
											<label class="col-lg-2 control-label">返回时间</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['end_time']|date='Y-m-d H:i',###}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">交通工具</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['vehicle']}
												</p>
											</div>
											<label class="col-lg-2 control-label">住宿(天)</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['duration']}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">备注</label>
											<div class="col-lg-10">
												<span>
													{$info['description']}
												</span>
											</div>
										</div>
									</case>
									<case value="6">
										<div class="form-group">
											<label class="col-lg-2 control-label">借款人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.owner_name}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">审批人</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['examine']['user_name']}
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">借款金额(元)</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info['budget']} 
												</p>
											</div>
										</div>
										<div class="form-group">
											<label class="col-lg-2 control-label">借款事由</label>
											<div class="col-lg-4">
												<p class="form-p">
													{$info.content}
												</p>
											</div>
										</div>
									</case>
								</switch>
									
								</div>
								<div style="font-size:13px;font-weight:700;margin-top:20px;margin-bottom:15px;">
									<span style="border-left:5px solid #19AA8D;padding-left:10px;height:10px;"></span>审核信息
								</div>
								<div>
									<volist name="check_list" id="vo">
										<if condition="$key gt 0">
											<div class="pull-left" style="margin-top:12px;margin-left:15px;font-size:22px;color:#ccc;"><i class="fa fa-long-arrow-right"></i></div>
										</if>
										<div class="pull-left" style="margin-left:0px;">
											<img src="{$vo['user']['img']}" style="width:45px;height:45px;margin:10px 0 0 10px;border-radius:50px;">
										</div>
										<div class="pull-left" style="margin:10px 0 0 10px;">
											<div class="control-label" style="margin-top:2px;font-size:14px;color:#B4B1C2">
												{$vo['user']['full_name']}
											</div>
											<div class="control-label check_badge" style="margin-top:2px;font-size:13px;">
												<if condition="$vo['is_checked'] eq 1">
													<span style="color:#19AA8D">通过</span>
												<elseif condition="$vo['is_checked'] eq 2"/>
													<span style="color:#F5715F">拒绝</span>
												<else />
													<span style="color:#F5CA00">待审</span>
												</if>
											</div>
										</div>
									</volist>
									<div style="clear:both"></div>
								</div>
								<div style="margin-top:20px;margin-left:15px;"><a href="javascript:void(0);" id="check_list"><i class="fa fa-history"></i>&nbsp;&nbsp;查看审批记录</a></div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div style="display:none" id="dialog-add-examine" title="添加审批">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none;" id="dialog-check-list" title="审核记录">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(".file_tr").mouseenter(function(){
		$(this).find(".controls_file").show();
	}).mouseleave(function(){
		$(this).find(".controls_file").hide();
	});
	/**
	 * 附件 如果是图片时 双击可查看大图
	 */
	$('.litebox_file').liteBox({
	  revealSpeed: 400,
	  background: 'rgba(0,0,0,.8)',
	  overlayClose: true,
	  escKey: true,
	  navKey: true,
	  errorMessage: '图片加载失败.'
	});
	$("#dialog-check-list").dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		maxHeight: 400,
		position: ["center",100],
	});
	$("#check_list").click(function(){
		$('#dialog-check-list').dialog('open');
		$('#dialog-check-list').load('{:U("examine/check_list","id=".$info["examine_id"])}');
	});
	$("#dialog-add-examine").dialog({
		autoOpen: false,
		modal: true,
		width: 550,
		maxHeight: 450,
		position: ["center",100],
		buttons: {
			"确定": function () {
				if($('#openrecycle2').is(":checked")) {
					if($('#examine_role_id').val() == ''){
						alert_crm('下一审批人不能为空！');
						return false;
					}
				}
				$('#form_check').submit();
				$(this).dialog("close");
			},
			"取消": function () {
				$(this).dialog("close");
			}
		}
	});
	//审核
	$("#check_examine").click(function(){
		$('#dialog-add-examine').dialog('open');
		$('#dialog-add-examine').load('{:U("examine/add_examine","id=")}'+$(this).attr('rel')+"&type="+$(this).attr('rel2')); 
	});
</script>
<include file="Public:footer" />	